package com.student.wym.service.impl;

import com.student.wym.mapper.TeacherMapper;
import com.student.wym.po.Teacher;
import com.student.wym.service.ITeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherServiceImpl implements ITeacherService {

    @Autowired
    private TeacherMapper teacherMapper;

    @Override
    public Teacher findOne(String username) {
        Teacher teacher = teacherMapper.findOne(username);
        return teacher;
    }

    @Override
    public List<Teacher> getAll() {
        return teacherMapper.findAll();
    }

    @Override
    public void delete(int id) {
        teacherMapper.delete(id);
    }

    @Override
    public void save(Teacher teacher) {
        teacherMapper.save(teacher);
    }

    @Override
    public void update(Teacher teacher) {
        teacherMapper.update(teacher);
    }

    @Override
    public void loginInfo(Teacher teacher) {
        teacherMapper.loginInfo(teacher);
    }

}
